package com.hits.zzbzstart;

import com.hits.zzbzstart.service.InitDataService;
import com.hits.zzbzstart.service.InstallRedisService;
import com.hits.zzbzstart.util.Decompression;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import javax.servlet.http.HttpServletRequest;

/**
 * @author wangshen
 * @ClassName 启动时默认执行
 * @Description TODO
 * @date 2020/12/22
 */
@Configuration
public class WebAppConfig {


    @Autowired
    private InitDataService initDataService;

    @Autowired
    private InstallRedisService redisService;

    //初始化加载数据到redis
    @PostConstruct
    public void initData() {
        System.out.println("初始化启动执行了 --- @PostConstruct");
        if (redisService.install()) {
            initDataService.initData();
        }

    }


}
